﻿package org.nickro.project.utils {

    public class Errors {

        public function Errors(){
            throw (new Error("ERROR com.tobyfreeman.utils.Errors constructor: Class never intended to be instantiated"));
        }
        public static function traceError(str:String, err:Object):String{
            str = (((((((("/error/ " + str) + ": ") + err.name) + " - ") + err.message) + "\nDATA='") + err.data) + "'");
            trace(str);
            return (str);
        }
        public static function toString(e:Error, showStack:Boolean=true):String{
            var str:String = ((((("/error/ " + e.errorID) + " '") + e.name) + "': ") + e.message);
            if (showStack){
                str = (str + ((" [" + e.getStackTrace()) + "]"));
            };
            return (str);
        }
        public static function descToString(str:String, err:Object):String{
            str = ((((str is String)) && (!((str == ""))))) ? (str + ":\n") : "";
            return (((((((str + err.name) + " - ") + err.message) + "\nDATA='") + err.data) + "'"));
        }

    }
}